/*******************************************************************************
 * Copyright (c) 2010 marvin.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     marvin - initial API and implementation
 ******************************************************************************/

package com.marv42.ebt.newnote.scanning;

import java.io.File;

import com.marv42.ebt.newnote.EbtNewNote;

import android.content.Context;
import android.os.Environment;
import android.util.Log;



public class PhotoSaveLocation
{
   public static final String PICTURE_FILE = "EuroBill.jpg";



   public static final File
   getPath(Context context)
   {
      final File path = new File(Environment.getExternalStorageDirectory().getPath()/*.getAbsolutePath()*/,
                                  context.getPackageName());
      if (! path.exists())
         if (! path.mkdirs())
            Log.e(EbtNewNote.LOG_TARGET, "Couldn't create directory " + path);
      File file = new File(path, PICTURE_FILE);
//      file.deleteOnExit();
      Log.d(EbtNewNote.LOG_TARGET, "getPath: " + file.getAbsolutePath());
      return file;
   }
}
